package uy.com.dino.samefile.model;


import javax.persistence.Column;
import javax.persistence.Entity;

@Entity
public class FileInfo extends PersistentEntity {

    @Column
    private String name;

    @Column
    private String description;

    @Column
    private String path;

    @Column
    private String hashCode;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getHashCode() {
        return hashCode;
    }

    public void setHashCode(String hashCode) {
        this.hashCode = hashCode;
    }

    @Override
    public String toString() {
        return hashCode + " {" + description + "}(" + name + ")[" + path + "]";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FileInfo fileInfo = (FileInfo) o;

        if (hashCode != null ? !hashCode.equals(fileInfo.hashCode) : fileInfo.hashCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return hashCode != null ? hashCode.hashCode() : 0;
    }
}
